package com.sdp.irrigation.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.sdp.core.bizc.vo.DataCenter;
import com.sdp.core.bizc.vo.Result;
import com.sdp.right.control.SysDictController;

@RestController
@RequestMapping("/AppExcludeController")
public class AppExcludeController {

	@Autowired
	private IrrigationAboutController irrigationAboutController;
	
	@Autowired
	private IrrigationOperateController irrigationOperateController;
	
	@Autowired
	private IrrigationExpertController irrigationExpertController;
	
	@Autowired
	private IrrigationNoticeController irrigationNoticeController;
	
	@Autowired
	private IrrigationBannerInfoController irrigationBannerInfoController;
	
	@Autowired
	private IrrigationAsController irrigationAsController;
	
	@Autowired
	private SysDictController sysDictController;
	
	/**
	 * 关于我们
	 * @return
	 */
	@GetMapping(value="/queryAbout")
	public Result<?> queryAbout() {
		return irrigationAboutController.queryAbout();
	}
	
	/**
	 * 操作指南
	 * @return
	 */
	@GetMapping(value="/queryOperate")
	public Result<?> queryOperate() {
		return irrigationOperateController.queryOperate();
	}
	
	/**
	 * 知名专家列表
	 * @param dataCenter
	 * @return
	 */
	@PostMapping(value = "/expertPage")
	public Result<?> expertPage(@RequestBody DataCenter dataCenter) {
		return irrigationExpertController.page(dataCenter);
	}
	
	/**
	 * 前沿资讯，通知公告
	 * @param dataCenter
	 * @return
	 */
	@PostMapping(value = "/noticePage")
	public Result<?> noticePage(@RequestBody DataCenter dataCenter) {
		return irrigationNoticeController.page(dataCenter);
	}
	
	/**
	 * 轮播图列表
	 * @param dataCenter
	 * @return
	 */
	@PostMapping(value = "/bannerPage")
	public Result<?> bannerPage(@RequestBody DataCenter dataCenter) {
		return irrigationBannerInfoController.page(dataCenter);
	}
	
	/**
	 * 售后信息，服务网点
	 * @param dataCenter
	 * @return
	 */
	@PostMapping(value = "/asPage")
	public Result<?> asPage(@RequestBody DataCenter dataCenter) {
		return irrigationAsController.page(dataCenter);
	}
		
	/**
	 * 获取下拉
	 * @param dictCode
	 * @param dictParam
	 * @return
	 */
	@GetMapping(value = "/getDictInfo")
	public Result<?> getDictInfo(@RequestParam(name="dictCode",required=true) String dictCode,@RequestParam(name="dictParam",defaultValue="") String dictParam) {
		return sysDictController.getDictInfo(dictCode, dictParam);
	}
}
